home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / programm / GNU_C++ / LIB / MTLB49CF.LZH / src / diffs.CF next >
Encoding:
Text File  |  2000-01-04  |  14.9 KB  |  648 lines

  1. --- orig/src/PatchLev.h    Tue Jan  4 15:31:56 2000
  2. +++ ./src/PatchLev.h    Sun Jul 11 11:08:30 1999
  3. @@ -3,4 +3,4 @@
  4.   *    directory.
  5.   */
  6.  
  7. -#define PatchLevel "49"
  8. +#define PatchLevel "49cf"
  9.  
  10. diff -ur orig/src/clock.c ./src/clock.c
  11. --- orig/src/clock.c    Fri May 29 18:57:24 1998
  12. +++ ./src/clock.c    Sun Aug  1 12:13:20 1999
  13. @@ -2,37 +2,15 @@
  14.     per second (under TOS, 200 per second) */
  15.  /* written by ERS */
  16.  
  17. +#include <sysvars.h>
  18.  #include <time.h>
  19. -#include <osbind.h>
  20. -#include <mintbind.h>
  21. -#include <ssystem.h>
  22.  
  23.  extern clock_t _starttime; /* in main.c */
  24.  
  25. -static clock_t now;
  26. -
  27. -/* this must execute in supervisor mode; it fetches the system variable
  28. - * containing the number of 200HZ ticks since the system was booted
  29. - */
  30. -
  31. -static long getnow __PROTO((void));
  32. -
  33. -static long
  34. -getnow()
  35. -{
  36. -    now = *((unsigned long *) 0x4baL);
  37. -    return 0;
  38. -}
  39. -
  40.  clock_t
  41.  _clock()
  42.  {
  43. -    if (Ssystem(-1, NULL, NULL)) {
  44. -        (void)Supexec(getnow);
  45. -        return (now - _starttime);
  46. -    }
  47. -    else
  48. -        return (Ssystem(GET_LVAL, 0x000004baL, NULL) - _starttime);
  49. +    return (get_sysvar(_hz_200) - _starttime);
  50.  }
  51.  
  52.  /* This next bit of nonsense is temporary...clock() should be fixed! */
  53.  
  54. diff -ur orig/src/crtinit.c ./src/crtinit.c
  55. --- orig/src/crtinit.c    Fri May 29 18:57:26 1998
  56. +++ ./src/crtinit.c    Sun Aug  1 12:38:00 1999
  57. @@ -83,6 +83,7 @@
  58.  #include <basepage.h>
  59.  #include <osbind.h>
  60.  #include <support.h>
  61. +#include <sys/cookie.h>
  62.  #include "lib.h"
  63.  
  64.  #define isspace(c) ((c) == ' '||(c) == '\t')
  65. @@ -410,16 +411,74 @@
  66.      while(i > 0 && isspace(*cmdln) )
  67.          cmdln++,--i;
  68.  
  69. -    while (i > 0) {
  70. -        if (isspace(*cmdln)) {
  71. -            --i; cmdln++;
  72. -            while (i > 0 && isspace(*cmdln))
  73. -                --i,cmdln++;
  74. -            *to++ = 0;
  75. +    /* 
  76. +     * MagXDesk only uses ARGV if the arg is longer than the 126 character
  77. +     * of bp->cmdlin. If the arg is short enough and contains a file name with
  78. +     * blanks it will be come quoted via bp->cmdlin!!
  79. +    */ 
  80. +    if (Getcookie(C_MagX, NULL) == C_FOUND && cmdln[0] != '\'')
  81. +    {
  82. +        while (i > 0) {
  83. +            if (isspace(*cmdln)) {
  84. +                --i; cmdln++;
  85. +                while (i > 0 && isspace(*cmdln))
  86. +                    --i,cmdln++;
  87. +                *to++ = 0;
  88. +            }
  89. +            else {
  90. +                if ((*to++ = *cmdln++) == 0) break;
  91. +                --i;
  92. +            }
  93.          }
  94. -        else {
  95. -            if ((*to++ = *cmdln++) == 0) break;
  96. -            --i;
  97. +    }
  98. +    else
  99. +    {
  100. +        int in_quote = 0;
  101. +        
  102. +        while (i > 0) 
  103. +        {
  104. +            if (*cmdln == '\'')
  105. +            {
  106. +                i--; 
  107. +                cmdln++;
  108. +                if (in_quote)
  109. +                {
  110. +                    if (*cmdln == '\'')        /* double ': file name contains ' */
  111. +                    {
  112. +                        *to++ = *cmdln++;
  113. +                        i--;
  114. +                    }
  115. +                    else
  116. +                    {
  117. +                        in_quote = 0;
  118. +                        *to++ = 0;                /* end of quoted arg */
  119. +                        i--; cmdln++;
  120. +                    }
  121. +                }
  122. +                else
  123. +                    in_quote = 1;
  124. +            }
  125. +            else
  126. +            {
  127. +                if (*cmdln == ' ')
  128. +                {
  129. +                    if (in_quote)
  130. +                    {
  131. +                        *to++ = *cmdln++;
  132. +                        i--;
  133. +                    }
  134. +                    else
  135. +                    {
  136. +                        --i; cmdln++;
  137. +                        *to++ = 0;
  138. +                    }
  139. +                }
  140. +                else
  141. +                {
  142. +                    *to++ = *cmdln++;
  143. +                    i--;
  144. +                }
  145. +            }
  146.          }
  147.      }
  148.      *to++ = '\0';
  149. --- orig/src/getcooki.c    Sun Oct 25 13:06:48 1998
  150. +++ src/getcooki.c    Tue Sep 28 17:14:36 1999
  151. @@ -9,30 +9,31 @@
  152.   * returns:
  153.   * 
  154.   *     - E_OK if cookie was found
  155. - *     - negative error number if cookie is missing
  156. + *     - EERROR if cookie is missing
  157.   *     
  158.   *     if p_value is set, cookie value is copied to *p_value
  159.   * 
  160.   */
  161.  
  162. -# include <osbind.h>
  163.  # include <mintbind.h>
  164. -# include <ssystem.h>
  165. +# include <mint/ssystem.h>
  166.  # include <errno.h> 
  167. -static long
  168. -getcookieptr (void)
  169. +# include <sysvars.h>
  170. +
  171. +extern int __has_no_ssystem;
  172. +
  173. +static long getcookieptr (void)
  174.  {
  175.      return *((long *) 0x5a0);
  176.  }
  177.  
  178. -int
  179. -Getcookie (long cookie, long *p_value)
  180. +int Getcookie(long cookie, long *p_value)
  181.  {
  182. -    if (Ssystem (-1, 0, 0)) /* better a global _has_ssystem? */
  183. +    if (__has_no_ssystem)
  184.      {
  185.          /* old method */
  186. -        
  187. -        long *cookieptr = (long *) Supexec (getcookieptr);
  188. +/*        long *cookieptr = (long *) get_sysvar(_p_cookies);*/
  189. +        long *cookieptr = (long *) Supexec(getcookieptr);
  190.          
  191.          if (cookieptr)
  192.          {
  193. @@ -49,12 +50,40 @@
  194.                  cookieptr += 2;
  195.              }
  196.          }
  197. -        
  198. +        if (p_value)
  199. +            *p_value = 0;
  200. +    
  201.          return EERROR;
  202.      }
  203. -    
  204. -    /* Ssystem supported, use it */
  205. -    
  206. -    return Ssystem (GETCOOKIE, cookie, p_value);
  207. -}
  208. +    else
  209. +    {
  210. +        /* Ssystem supported, use it */
  211. +        int    r;
  212. +        long    v = -42;
  213.  
  214. +        if (p_value)
  215. +            *p_value = 0;
  216. +
  217. +        r = Ssystem(S_GETCOOKIE, cookie, &v);
  218. +
  219. +        /*
  220. +         * Backward compatibility for MiNT 1.14.7:
  221. +         * Ssystems() returns cookie value and ignores arg2!!
  222. +         */
  223. +        if (r != -1 && v == -42)                
  224. +            v = r;
  225. +        if (r == -1)                            /* not found */
  226. +        {
  227. +            v = 0;
  228. +            r = EERROR;
  229. +        }
  230. +        else
  231. +            r = E_OK;
  232. +
  233. +        if (p_value)
  234. +            *p_value = v;
  235. +
  236. +        return r;
  237. +    }
  238. +}
  239. diff -ur orig/src/ioctl.c ./src/ioctl.c
  240. --- orig/src/ioctl.c    Fri May 29 18:57:58 1998
  241. +++ ./src/ioctl.c    Sun Aug  1 12:27:50 1999
  242. @@ -11,11 +11,12 @@
  243.  #include <linea.h>    /* for TIOCGWINSZ under TOS */
  244.  #include <support.h>
  245.  #include <stat.h>
  246. -#include <ssystem.h>
  247. +#include <mint/ssystem.h>
  248.  #include <types.h>
  249.  #include "lib.h"    /* for __open_stat */
  250.  
  251.  extern int __mint;    /* MiNT version */
  252. +extern int __has_no_ssystem;
  253.  int _ttydisc = NTTYDISC;
  254.  int _ldisc = LLITOUT;
  255.  
  256. @@ -160,12 +161,12 @@
  257.                    *msig |= ((g & (1 << 3)) ? 0 : TIOCM_RTS);
  258.                    *msig |= ((g & (1 << 4)) ? 0 : TIOCM_DTR);
  259.                    mfp = ((short *) 0xfffffa00L);
  260. -          if (Ssystem(-1,NULL,NULL)) {
  261. +          if (__has_no_ssystem) {
  262.                        ssp = Super(0L);
  263.                        m = *mfp & 0xff;
  264.                        Super(ssp);
  265.            } else
  266. -              m = (short)(Ssystem(TIOCMGET, (u_long)mfp, NULL));
  267. +              m = (short)(Ssystem(S_TIOCMGET, (u_long)mfp, NULL));
  268.                    *msig |= ((m & (1 << 1)) ? 0 : TIOCM_CAR);
  269.                    *msig |= ((m & (1 << 2)) ? 0 : TIOCM_CTS);
  270.                    *msig |= ((m & (1 << 6)) ? 0 : TIOCM_RNG);
  271. diff -ur orig/src/localtim.c ./src/localtim.c
  272. --- orig/src/localtim.c    Wed Oct 14 16:37:38 1998
  273. +++ ./src/localtim.c    Sun Aug  1 11:59:22 1999
  274. @@ -2,9 +2,6 @@
  275.  ** This file is in the public domain, so clarified as of
  276.  ** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
  277.  */
  278. -#include "PatchLev.h"
  279. -static char  PATCHid[] = "$Patchlevel: MiNT library, localtim.c " PatchLevel " $"; 
  280. -
  281.  #ifndef lint
  282.  #ifndef NOID
  283.  static char    elsieid[] = "@(#)localtime.c    7.61";
  284. diff -ur orig/src/main.c ./src/main.c
  285. --- orig/src/main.c    Fri May 29 18:58:16 1998
  286. +++ ./src/main.c    Sun Aug  1 12:18:16 1999
  287. @@ -13,7 +13,9 @@
  288.  #include <unistd.h>
  289.  #include <ctype.h>
  290.  #include <param.h>
  291. -#include <ssystem.h>
  292. +#include <sysvars.h>
  293. +#include <mint/ssystem.h>
  294. +#include <sys/cookie.h>
  295.  #include "lib.h"
  296.  
  297.  int    errno;
  298. @@ -30,51 +32,7 @@
  299.  typedef void (*ExitFn) __PROTO((void));
  300.  ExitFn *_at_exit;
  301.  int _num_at_exit;    /* number of functions registered - 1 */
  302. -static int no_ssystem;
  303. -
  304. -/*
  305. - * get MiNT version number. Since this has to be done in supervisor mode,
  306. - * we might as well set the start-up time of the system here, too.
  307. - */
  308. -/* this function is called in user mode if the kernel supports Ssystem() */
  309. -static long getMiNT __PROTO((void));
  310. -
  311. -static long
  312. -getMiNT()
  313. -{
  314. -    long *cookie;
  315. -
  316. -/* get the system time in 200HZ ticks from the BIOS _hz_200 variable */
  317. -    if (no_ssystem)
  318. -        _starttime = *((unsigned long *) 0x4baL);
  319. -    else
  320. -        _starttime = Ssystem(GET_LVAL, 0x000004baL, NULL);
  321. -
  322. -    _childtime = 0;
  323. -
  324. -    if (no_ssystem) {
  325. -        cookie = *((long **) 0x5a0L);
  326. -        if (!cookie)
  327. -            __mint = 0;
  328. -        else {
  329. -            while (*cookie) {
  330. -                if (*cookie == 0x4d694e54L) {    /* MiNT */
  331. -                    __mint = (int) cookie[1];
  332. -                    return 0;
  333. -                }
  334. -                cookie += 2;
  335. -            }
  336. -
  337. -        }
  338. -
  339. -    }
  340. -    else {
  341. -        __mint = (int)Ssystem(GETCOOKIE, 0x4d694e54L, NULL);
  342. -        return 0;
  343. -    }
  344. -    __mint = 0;
  345. -    return 0;
  346. -}
  347. +int __has_no_ssystem;
  348.  
  349.  /* supplied by the user */
  350.  __EXTERN int main __PROTO((int, char **, char **));
  351. @@ -102,6 +60,7 @@
  352.      register FILE *f;
  353.      register int i;
  354.      char *s, *pconv;
  355. +    long l;
  356.      extern int __default_mode__;    /* in defmode.c or defined by user */
  357.      extern short _app;    /* tells if we're an application or acc */
  358.  
  359. @@ -115,14 +74,17 @@
  360.      _fpuinit();
  361.  #endif
  362.  
  363. +    __has_no_ssystem = (int)Ssystem(-1, NULL, NULL);
  364. +    _starttime = get_sysvar(_hz_200);
  365. +    _childtime = 0;
  366. +        
  367.  /*
  368.   * check for MiNT
  369.   */
  370. -    no_ssystem = Ssystem(-1, NULL, NULL);
  371. -    if (no_ssystem)
  372. -        (void)Supexec(getMiNT);
  373. +    if (Getcookie(C_MiNT, &l) == C_FOUND)
  374. +        __mint = (int) l;
  375.      else
  376. -        (void)getMiNT();
  377. +        __mint = 0;
  378.  
  379.      if (_app)
  380.          _pdomain = Pdomain(1);    /* set MiNT domain */
  381. diff -ur orig/src/opendir.c ./src/opendir.c
  382. --- orig/src/opendir.c    Fri May 29 18:58:24 1998
  383. +++ ./src/opendir.c    Sun Aug  1 12:04:00 1999
  384. @@ -64,7 +64,7 @@
  385.  
  386.              /* test if the file system is case sensitive */
  387.              r = Dpathconf(name, 6);
  388. -            if (r > 0)
  389. +            if (r == 1 || r == -EINVAL)
  390.                  d->status = _NO_CASE;
  391.              else
  392.                  d->status = 0;
  393. diff -ur orig/src/spawn.c ./src/spawn.c
  394. --- orig/src/spawn.c    Fri May 29 18:59:06 1998
  395. +++ ./src/spawn.c    Sun Aug  1 12:10:28 1999
  396. @@ -468,7 +468,7 @@
  397.  /* MiNT supports overlays with Pexec(200,...) */
  398.  
  399.      if (mode == P_NOWAIT) cmlen = 100;
  400. -    else if (mode == P_OVERLAY && __mint) cmlen = 200;
  401. +    else if (mode == P_OVERLAY) cmlen = 200;
  402.      else cmlen = 0;
  403.  
  404.      rval = Pexec((int)cmlen, path, cmd, env);
  405. diff -ur orig/src/statfs.c ./src/statfs.c
  406. --- orig/src/statfs.c    Sun Oct 18 05:55:34 1998
  407. +++ ./src/statfs.c    Sun Aug  1 12:05:06 1999
  408. @@ -17,7 +17,7 @@
  409.  #include <sys/statfs.h> 
  410.  
  411.  /* from kernel source! */
  412. -#include <dcntl.h>
  413. +#include <mint/dcntl.h>
  414.  
  415.  extern int __mint;
  416.  
  417. @@ -118,12 +118,12 @@
  418.      }
  419.      else
  420.      {
  421. -        if (Dcntl(MX_KER_XFSNAME, path, xname) >= 0)    /* MagiC: only one name available */
  422. +        if (Dcntl(MX_KER_XFSNAME, path, (long)xname) >= 0)    /* MagiC: only one name available */
  423.              strcpy(tname, xname);
  424.          else
  425.          {
  426. -            strcpy(xfs_name, "tos-fs");
  427. -            strcpy(type_name, "tos");
  428. +            strcpy(xname, "tos-fs");
  429. +            strcpy(tname, "tos");
  430.          }
  431.      }
  432.  
  433. diff -ur orig/src/sysvar.c ./src/sysvar.c
  434. --- orig/src/sysvar.c    Fri May 29 18:59:46 1998
  435. +++ ./src/sysvar.c    Sun Aug  1 12:28:12 1999
  436. @@ -1,7 +1,9 @@
  437.  #include <support.h>
  438.  #include <osbind.h>
  439.  #include <mintbind.h>
  440. -#include <ssystem.h>
  441. +#include <mint/ssystem.h>
  442. +
  443. +extern int __has_no_ssystem;
  444.  
  445.  long
  446.  get_sysvar(var)
  447. @@ -10,7 +12,7 @@
  448.      long ret;
  449.      long save_ssp;
  450.  
  451. -    if(Ssystem(-1, NULL, NULL)) {    
  452. +    if(__has_no_ssystem) {    
  453.              save_ssp = (long) Super((void *) 0L);
  454.          /* note: dont remove volatile, otherwise gcc will reorder these
  455.             statements and we get bombs */
  456. @@ -19,7 +21,7 @@
  457.              return ret;
  458.      }
  459.      else
  460. -        return Ssystem(GET_LVAL, var, NULL);
  461. +        return Ssystem(S_GETLVAL, var, NULL);
  462.  }
  463.  
  464.  void
  465. @@ -29,11 +31,11 @@
  466.  {
  467.      long save_ssp;
  468.  
  469. -    if(Ssystem(-1, NULL, NULL)) {    
  470. +    if(__has_no_ssystem) {    
  471.              save_ssp = (long) Super((void *) 0L);
  472.              *((volatile long *)var) = val;
  473.              (void)Super((void *) save_ssp);
  474.      }
  475.      else
  476. -        (void)Ssystem(SET_LVAL, var, val); /* note: root only! */
  477. +        (void)Ssystem(S_SETLVAL, var, val); /* note: root only! */
  478.  }
  479. diff -ur orig/src/time.c ./src/time.c
  480. --- orig/src/time.c    Fri May 29 19:00:00 1998
  481. +++ ./src/time.c    Sun Aug  1 12:06:58 1999
  482. @@ -12,6 +12,7 @@
  483.  
  484.  #include <time.h>
  485.  #include <mintbind.h>
  486. +#include <sys/cookie.h>
  487.  #include "lib.h"
  488.  
  489.  
  490. @@ -132,7 +133,7 @@
  491.      time_t    made; struct timeval tv;
  492.  
  493.      if(CLOCK_cookie == -1)
  494. -        Getcookie(0x434c4f4bL, &CLOCK_cookie); /* 'CLOK' */
  495. +        Getcookie(C_CLOK, &CLOCK_cookie);
  496.  
  497.      if(CLOCK_cookie & OS_HAS_TgetTOD) {
  498.          Tgettimeofday(&tv, NULL);
  499. diff -ur orig/src/timeoday.c ./src/timeoday.c
  500. --- orig/src/timeoday.c    Fri Jun  5 03:25:06 1998
  501. +++ ./src/timeoday.c    Sun Aug  1 12:29:30 1999
  502. @@ -20,13 +20,10 @@
  503.  #include <types.h>
  504.  #include <time.h>
  505.  #include <unistd.h>
  506. -#ifdef __TURBOC__
  507. -#include <sys\timeb.h>
  508. -#else
  509.  #include <sys/timeb.h>
  510. -#endif
  511.  #include <mintbind.h>
  512. -#include <ssystem.h>
  513. +#include <mint/ssystem.h>
  514. +#include <sys/cookie.h>
  515.  
  516.  #ifdef HAS_BSD_TIME
  517.  extern    time_t    timezone; /* in localtime.c */
  518. @@ -40,6 +37,8 @@
  519.  
  520.  int _t_o_day_first = 1; /* changed by stime(),settimeofday(), if  successfull */
  521.  
  522. +extern int __has_no_ssystem;    /* main.c*/
  523. +
  524.  static struct timeval the_time;
  525.  static clock_t oticks;
  526.  
  527. @@ -51,17 +50,13 @@
  528.      return now;
  529.  }
  530.  
  531. -#ifdef HAS_SSYSTEM
  532.  clock_t getticks(void)
  533.  {
  534. -    if (Ssystem(-1, NULL, NULL))
  535. +    if (__has_no_ssystem)
  536.          return (clock_t)Supexec(getnow);
  537.      else
  538. -        return (clock_t)Ssystem(GET_LVAL, 0x000004baL, NULL);
  539. +        return (clock_t)Ssystem(S_GETLVAL, 0x000004baL, NULL);
  540.  }
  541. -#else
  542. -#define getticks()  (clock_t)Supexec(getnow)
  543. -#endif
  544.  
  545.  static void
  546.  tvadd (struct timeval *tv1, struct timeval *tv2)
  547. @@ -85,7 +80,7 @@
  548.      clock_t diff, ticks;
  549.      long clockcookie;
  550.      
  551. -    Getcookie(0x434c4f4bL, &clockcookie);    /* 'CLOK'    */
  552. +    Getcookie(C_CLOK, &clockcookie);
  553.      if(!(clockcookie & (16L<<24))) {    /* OS_HAS_TgetTOD    */
  554.          ticks = getticks(); /* DON'T replace by Supexec(getnow) ! */
  555.      
  556. diff -ur orig/src/uname.c ./src/uname.c
  557. --- orig/src/uname.c    Fri May 29 19:00:14 1998
  558. +++ ./src/uname.c    Sun Aug  1 14:43:16 1999
  559. @@ -13,57 +13,34 @@
  560.  #include <osbind.h>
  561.  #include <stdio.h>
  562.  #include <string.h>
  563. -#include <ssystem.h>
  564. +#include <mint/ssystem.h>
  565.  #include <mintbind.h>
  566. -#ifdef __TURBOC__
  567. -#include <sys\utsname.h>
  568. -#else
  569.  #include <sys/utsname.h>
  570. -#endif
  571. +#include <sys/cookie.h>
  572. +#include <sysvars.h>
  573.  
  574.  extern int __mint;
  575. +extern int __has_no_ssystem;
  576. +
  577.  __EXTERN int gethostname __PROTO((char *buf, size_t len));
  578.  
  579.  static long _mch;    /* value of the _MCH cookie, if any */
  580. -static int tosvers;    /* TOS version number */
  581. +static int tosvers = 0;    /* TOS version number */
  582.  
  583.  /*
  584.   * get operating system information; must execute in supervisor mode
  585.   */
  586.  
  587.  static long getinfo __PROTO((void));
  588. -static int no_ssystem;
  589.  
  590.  static long
  591.  getinfo()
  592.  {
  593. -    long *cookie, *sysbase;
  594. -
  595. -/* get _MCH cookie value */
  596. -    if(no_ssystem) {
  597. -        cookie = *((long **) 0x5a0L);
  598. -        if (cookie) {
  599. -            while (*cookie) {
  600. -                if (*cookie == 0x5f4d4348L) {    /* _MCH */
  601. -                    _mch = cookie[1];
  602. -                    break;
  603. -                }
  604. -                cookie += 2;
  605. -            }
  606. -
  607. -        }
  608. -
  609. -    }
  610. -    else
  611. -        _mch = Ssystem(GETCOOKIE, 0x5f4d4348L, NULL);
  612. +    long *sysbase;
  613.  
  614.  /* get TOS version number */
  615. -    if (no_ssystem) {
  616. -        sysbase = *((long **)(0x4f2L));
  617. -        tosvers = (int)(sysbase[0] & 0x0000ffff);
  618. -    }
  619. -    else
  620. -        tosvers = (int)(Ssystem(TOSHEADER, 0L, NULL)&0x0000ffff);
  621. +    sysbase = *((long **)(0x4f2L));
  622. +    tosvers = (int)(sysbase[0] & 0x0000ffff);
  623.  
  624.      return 0;
  625.  }
  626. @@ -74,13 +51,15 @@
  627.  uname(buf)
  628.      struct utsname *buf;
  629.  {
  630. -    no_ssystem = Ssystem(-1, NULL, NULL);
  631. -    if (no_ssystem) {
  632. -        if (!tosvers)
  633. +    if (!tosvers)
  634. +    {
  635. +        if (__has_no_ssystem)
  636.              (void)Supexec(getinfo);
  637. +        else
  638. +            tosvers = (int)(Ssystem(S_OSHEADER, 0L, NULL) & 0x0000ffff);
  639.      }
  640. -    else
  641. -        getinfo();
  642. +
  643. +    Getcookie(C__MCH, &_mch);
  644.  
  645.      strcpy(buf->sysname, __mint ? "MiNT" : "TOS");
  646.  
  647.